﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media.Animation;
using System.Windows.Media;

namespace IMap
{
    /// <summary>
    /// Radar.xaml 的交互逻辑
    /// </summary>
    public partial class Radar : UserControl
    {
        private RotateTransform animatedRotateTransform;
        public Radar()
        {
            InitializeComponent();
            //http://technet.microsoft.com/zh-cn/library/ms750634%28v=vs.90%29
            animatedRotateTransform = new RotateTransform();
            animatedRotateTransform.Angle = 45;
            DoubleAnimation angleAnimation = new DoubleAnimation(0, 360, TimeSpan.FromSeconds(5));
            angleAnimation.RepeatBehavior = RepeatBehavior.Forever;
            animatedRotateTransform.BeginAnimation(RotateTransform.AngleProperty, angleAnimation);
            SweepLine.RenderTransform = animatedRotateTransform;
            //SweepLine默认长度为1,虽然其Stretch="Uniform"
            SweepLine.RenderTransformOrigin = new Point(0, 1);

        }

    }

}
